﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Devfw.OpenAuth.Platform;
using System.Configuration;

namespace WebSite.ThirdPartyLogin
{
    public partial class SinaAuth : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string apiKey = ConfigurationManager.AppSettings["SinaApiKey"];
            string apiSecret = ConfigurationManager.AppSettings["SinaApiSecret"];
            string callback = ConfigurationManager.AppSettings["SinaCallbackUrl"]; 

            SinaV2 sina = new SinaV2( apiKey, apiSecret);
            string authUrl = sina.GetAuthorizeUrl(callback);
            

            //Response.Write(sina.GetAuthorizeUrl(""));
            //var oauth = new NetDimension.Weibo.OAuth(apiKey, apiSecret, callback);
            //string authUrl = oauth.GetAuthorizeURL( );
            
            // Response.Write(authUrl);
            Response.Redirect(authUrl);

        }
    }
}